<template>
    <div class="school">
        <h2>我是School组件</h2>
        <h3>学校名称：{{info.name}}</h3>
        <h3>学校地址：{{info.address}}</h3>
        <button @click="handleClick">将我自己的学校名交给News</button>
    </div>
</template>

<script>
    export default {
        name: 'School',
        data() {
            return {
                info: {
                    name: '尚硅谷',
                    address: '宏福科技园'
                }

            }
        },
        methods: {
            handleClick() {
                this.$bus.$emit('getMsg', this.info)
            }
        }
    }
</script>

<style scoped>
    .school {
        background-color: orange;
        padding: 20px;
    }
</style>